feat: support extending completed projects in mgw:project#67
Merged
snipcodeit merged 4 commits intomainfrom Feb 27, 2026
Merged
feat: support extending completed projects in mgw:project#67snipcodeit merged 4 commits intomainfrom
snipcodeit merged 4 commits intomainfrom
Conversation
- New mergeProjectState(newMilestones, newPhaseMap, newCurrentMilestone) function - Loads existing project state, appends milestones, merges phase_map - Preserves all existing data (completed milestones, project config, board) - Sets current_milestone to point at first new milestone (1-indexed) - Writes merged state back via writeProjectState - Exported alongside existing state functions
- verify_repo detects all-milestones-complete via ALL_COMPLETE check - Sets EXTEND_MODE=true, EXISTING_MILESTONE_COUNT, EXISTING_PHASE_COUNT - gather_inputs loads existing metadata and asks for new work in extend mode - create_issues initializes GLOBAL_PHASE_NUM from EXISTING_PHASE_COUNT in extend mode - create_project_board reuses existing board via project.project_board in extend mode - write_project_json calls mergeProjectState instead of full write in extend mode - report shows PROJECT EXTENDED banner in extend mode - success_criteria includes extend mode criterion - Non-extend path (Project already initialized exit) preserved
- Add 'Extending a Completed Project' workflow walkthrough section - Update /mgw:project command reference with extend mode description - Add FAQ entry 'How do I add more milestones after completing all of them?'
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Owner
Author
Testing ProceduresPrerequisites
Test Steps1. Fresh Init (regression check) # In a new repo without .mgw/project.json
/mgw:project
# Expected: normal fresh initialization flow2. Incomplete Milestones (regression check) # In a repo with active milestones (current_milestone <= len(milestones))
/mgw:project
# Expected: "Project already initialized. Run /mgw:milestone to continue."3. Extend Mode (new behavior) # In a repo where all milestones are done (current_milestone > len(milestones))
/mgw:project
# Expected: detects all complete, prompts for new milestone scope
# Verify: existing milestones preserved, new ones appended
# Verify: phase numbers continue from max existing (not restart at 1)
# Verify: existing GitHub Projects board reused4. State Integrity # After extend, check .mgw/project.json
node -e "const s = require('./lib/state.cjs'); console.log(JSON.stringify(s.loadProjectState(), null, 2))"
# Verify: old milestones intact, new milestones appended
# Verify: current_milestone points to first new milestone
# Verify: phase_map merged correctly5. lib/state.cjs Export Check node -e "const s = require('./lib/state.cjs'); console.log(Object.keys(s))"
# Expected: all original exports plus mergeProjectState |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
/mgw:project— when all milestones are complete, detects this state and offers to extend with new milestones instead of blocking with "Project already initialized"mergeProjectState()tolib/state.cjsfor append-based milestone merging that preserves existing project dataCloses #55
Changes
lib/state.cjsmergeProjectState(newMilestones, newPhaseMap, newCurrentMilestone)functioncommands/project.mdverify_repo: detects all-milestones-complete state, setsEXTEND_MODE=truegather_inputs: in extend mode, loads existing project context, asks only for new milestone scopecreate_issues:GLOBAL_PHASE_NUMstarts at existing phase count (continuation)create_project_board: reuses existing board viaproject.project_board.numberwrite_project_json: callsmergeProjectStateinstead of full overwrite in extend modereport: shows "PROJECT EXTENDED" banner with new/total countssuccess_criteria: updated for extend modedocs/USER-GUIDE.md/mgw:projectTest Plan
/mgw:projecton a repo with noproject.json— should behave as before (fresh init)/mgw:projecton a repo with incomplete milestones — should exit with "Project already initialized"/mgw:projecton a repo with all milestones complete (current_milestone > len(milestones)) — should enter extend modemergeProjectStatepreserves existing milestone data while appending new oneslib/state.cjsstill exports all original functions (no regression)Verification
All 7 must-haves verified against actual codebase:
🤖 Generated with Claude Code